<div class="view" id="c<?php echo $data->id; ?>">

    <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
    <?php echo CHtml::encode($data->id); ?>
    <br />

    <b><?php echo CHtml::encode($data->getAttributeLabel('datetime')); ?>:</b>
    <?php echo CHtml::encode(Yii::app()->dateFormatter->formatDateTime($data->datetime, 'medium', 'medium')); ?>    
    <br />

    <b><?php echo CHtml::encode($data->getAttributeLabel('status_id')); ?>:</b>
    <span style="color: red"><?php echo CHtml::encode($data->status->status); ?></span>
    <br />

    <b><?php echo CHtml::encode($data->getAttributeLabel('customer_id')); ?>:</b>
    <?php echo CHtml::encode($data->users->username); ?>
    <br />

    <b><?php echo CHtml::encode($data->getAttributeLabel('shipment_id')); ?>:</b>
    <?php echo CHtml::encode($data->shipment->name); ?>
    <br />

    <b><?php echo CHtml::encode($data->getAttributeLabel('totalprice')); ?>:</b>
    <?php echo CHtml::encode($data->totalprice); ?>
    <br />
    <b>Mặt hàng:</b>
    <br/>
    <?php
    $orderproducts = OrderProduct::model()->findAll('order_id = :order_id', array(':order_id' => $data->id));
    foreach ($orderproducts as $orderproduct) {
        printf('<b>%s</b> %s | Kho: %s <br/>', $orderproduct->amount, $orderproduct->product->name, $orderproduct->product->warehouse->location);
    }
    ?>
</div>